<extend name="Base/base" />
<block name="body">
<div class="container" style="margin-top:20px;">
  <input type="hidden" name="token" id="token" value="{$token}" />
  <div id="data"></div>
</div>
</block>
<block name="js">
<script>
$(function(){
  function get_data() {
    var token = $('#token').val();
    $.ajax({
      type: "POST",
      url: "/data_platform/get_api_data",
      data: {"token": token},
      dataType: 'json',
      success: function(result) {
        if (result.status == -1) {
          $('#data').html(result.msg);
        } else if (result.status == 0) {
          $('#data').append(result.msg);
        } else {
          $('#data').html(result.html);
          clearInterval(mi);
        }
      }
    });
  }
  mi = setInterval(get_data, 3000);
})
</script>
</block>
